# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-streql
pkgname=('python2-streql' 'python-streql')
_pkgname=streql
pkgver=3.0.2
pkgrel=6
pkgdesc='Constant-time string comparison.'
arch=('any')
url='https://pypi.org/project/streql/#files'
license=('APACHE')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('8bde506923f340ee454695a0d42bc262481c321082b914476a025d7276ed2402c504a10f62f765a32b3746f2e2be068ba76876803ead2819db0153f7524c41cd')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-streql() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

package_python-streql() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

